home *** CD-ROM | disk | FTP | other *** search
- include macros.asm
- Begincom hardlock
- jmp start
- msg0 db 'Hardlock Completed Sucessfully',10,13,'$'
- msg1 db 'Hardlock Disk I/O error.',10,13,'$'
-
- buffer db 512 dup(?)
-
- start proc near
- mov ax,0201h ;read one sector
- lea bx,buffer ;set up read address
- mov cx,1 ;read the partition table
- mov dx,0080h ;On drive C
- int 13H ;execute read
- jc IO_FAIL ;if carry - issue message
- mov byte ptr [bx+511],0 ;make disk unusable
- mov ax,0301h ;set up write command
- int 13H
- lea dx,msg0 ;point to OK message
- jnc SENDMSG ;display msg
- IO_FAIL: lea dx,msg1 ;point to failure message
- SENDMSG: mov ah,9 ;dos display string
- int 21h ;send message
- int 20h ;terminate program
- start endp
- endcom hardlock